package com.carbon.model;

/**
 * @author yeshusheng
 * @version 1.0.0
 * @date 2021/6/16 15:58
 * @description  统一返回结果 示例代码，后期修改或删除
 */
public class Result<T> {

	private String code;
	private String msg;
	private T result;

	public static final String codeSuccessfully = "000000";
	public static final String codeFailure = "000001";

	public Result() {
		super();
	}

	/**
	 * 初始化返回信息
	 * @param code
	 * @param msg
	 * @param result
	 */
	public Result(String code, String msg, T result) {
		super();

		this.code = code;
		this.msg = msg;
		this.result = result;
	}

	/**
	 * 初始化返回信息
	 * @param result
	 */
	public Result(T result) {
		super();

		this.code = Result.codeSuccessfully;
		this.msg = "";
		this.result = result;
	}

	public void setCode(String value) {
		this.code = value;
	}

	public String getCode() {
		return this.code;
	}

	public void setMsg(String value) {
		this.msg = value;
	}

	public String getMsg() {
		return this.msg;
	}

	public void setResult(T value) {
		this.result = value;
	}

	public T getResult() {
		return this.result;
	}

}
